package top.shiyiri.community.dao;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import top.shiyiri.community.bean.DiscussPost;

import java.util.List;

/**
 * @author Aunean
 * @date 2022/3/13 18:45
 */
@Repository
public interface DiscussPostMapper {

    List<DiscussPost> selectDiscussPosts(@Param("userId")int userId,@Param("offset") int offset,@Param("limit") int limit);

    //@Param注解用于给参数取别名
    int selectDiscussPostRows(@Param("userId") int userId);

    int insertDiscussPost(DiscussPost discussPost);

    DiscussPost selectDiscussPostById(@Param("id") int id);

    int updateCommentCount(@Param("id") int id, @Param("commentCount") int commentCount);

}
